package com.sifeng.springcloud;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableEurekaClient
@RestController
public class SpringcloudEurekaDiscoveryApplication {
	
	@RequestMapping("/api-a/hello")
	public String home() {
		System.out.println("===============================:/api-a/hello Hello discovery");	
		return "Hello discovery";
	}
	
	@RequestMapping("/api-b/hello")
	public String home2() {
		System.out.println("===============================:/api-b/hello Hello discovery");	
		return "Hello discovery";
	}

	public static void main(String[] args) {
//		SpringApplication.run(SpringcloudEurekaServerApplication.class, args);
		new SpringApplicationBuilder(SpringcloudEurekaDiscoveryApplication.class).web(true).run(args);
	}
}
